<template>
  <view class="search-container" :style="{backgroundColor: bgColor }" @click="gotoSearch">
    <view class="search" :style="{borderRadius: radius + 'rpx'}">
      <uni-icons type="search" size="20"></uni-icons>
      <view>搜索</view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    data() {
      return {
        
      };
    },
    props: {
      bgColor: {
        type: String,
        default: '#c00000'
      },
      radius: {
        type: Number,
        default: 40
      }
    },
    methods: {
      // 组件内部原生标签上的事件处理函数
      gotoSearch(){
        this.$emit('xxx', '跳转吧')
      }
    }
  }
</script>

<style lang="scss">
  .search-container {
    // background-color: #c00000;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20rpx;
    .search {
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: white;
      height: 70rpx;
      width: 100%;
      // border-radius: 70rpx;
      
      view {
        margin-left: 16rpx;
      }
    }
  }
</style>
